﻿using Mate.User.Service.Repository;
using System;
using System.Collections.Generic;
using System.Text;
using Mate.Db.Model;
using System.Threading.Tasks;
using Mate.Db.Dapper;

namespace Mate.User.Service
{
    public class UserService
    {
        #region 注入方式一
        //private readonly MateCloudDbContext _mateCloudDbContext;
        //private readonly IDapperRepository<Mate.Db.Model.User> _userRepository;

        //public UserService(MateCloudDbContext mateCloudDbContext)
        //{
        //    _mateCloudDbContext = mateCloudDbContext;
        //    _userRepository = new DapperRepository<Mate.Db.Model.User>(_mateCloudDbContext.Connection, _mateCloudDbContext._config);
        //}
        #endregion

        #region 注入方式二
        //private readonly UserRepository _userRepository;
        //public UserService(UserRepository userRepository)
        //{
        //    _userRepository = userRepository;
        //}
        #endregion

        //public async Task<bool> InsertUser(Mate.Db.Model.User user)
        //{
        //    return await _userRepository.InsertAsync(user);
        //}

        //public async Task<Mate.Db.Model.User> GetUserById(int id)
        //{
        //    return await _userRepository.FindAsync(x => x.id == id);
        //}
    }
}
